import React, { useEffect } from 'react';
import { PageContainer } from '@ant-design/pro-components';
import { init, plugins } from '@alilc/lowcode-engine';
import { useModel } from '@umijs/max';
import { Card, theme } from 'antd';

const Index2: React.FC = () => {
    useEffect(() => {
        try {
            console.log('init:', init); // 打印 init 函数

            const container = document.getElementById('lce-container');
            if (!container) {
                throw new Error('Container element not found');
            }

            init(container, {
                enableCondition: true,
                enableCanvasLock: true,
            });
        } catch (e) {
            console.error(e);
        }
    }, []);

    return (
        <PageContainer>
            <div id="lce-container" />
        </PageContainer>
    );
};

export default Index2;
